-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teardowndebug #26
Teardowndebug #26
Conversation
…ame vs os.environ var
…the message to "status cleared HH:MM:SS"
…he Globals resource.
… as the model and if none found, uses the self.details.ResourceModelName.
… alias-model vs model
… as the model and if none found, uses the self.details.ResourceModelName. fixes
else: | ||
self.model = self.details.ResourceModelName | ||
|
||
self.model = self.get_attrib_value_ending_in_model() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use the previous logic now that you fixed the attribute_exist function
return True | ||
return False | ||
|
||
# ----------------------------------------- | ||
# ----------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function is not needed anymore
@@ -20,9 +24,10 @@ def __init__(self, reservation_id, logger): | |||
""":type : logging.Logger""" | |||
self.api_session = helpers.get_api_session() | |||
self.id = reservation_id | |||
|
|||
self.owner = helpers.get_reservation_context_details().owner_user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the get_reservation_context_details result should be saved into a variable and then from there, you can take the owner and environment instead of calling this function twice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, now that we have the environmentPath, i would save it as well (self.environmentPath =..)
""" | ||
Report on an error to the log file, output window is optional.There is also an option to raise the error up | ||
:param str error_message: The error message you would like to present | ||
:param str log_message: The error message you would like to write to the log. Keep None to use the message param | ||
:param bool raise_error: Do you want to throw an exception | ||
:param bool write_to_output_window: Would you like to write the message to the output window | ||
""" | ||
|
||
emailresult = '' | ||
if raise_error: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these 2 ifs can be one
@@ -88,6 +115,51 @@ def report_info(self, message, log_message=None, write_to_output_window=False): | |||
self._write_message_to_output(message, SEVERITY_INFO) | |||
|
|||
# ---------------------------------- | |||
def emailalert(self, subject, body, owner, ishtml=False, emailOwner=False): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change it to private (_email_alert)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please review and fix based on the comments
sandbox_scripts/QualiEnvironmentUtils/Resource.py, line 25 at r1 (raw file): Previously, kalsky wrote…
I don't think so. The code defaults to the resource Model if there is no attribute, so we should leave the current code. Comments from Reviewable |
sandbox_scripts/QualiEnvironmentUtils/Resource.py, line 49 at r1 (raw file): Previously, kalsky wrote…
Hmmm. This will return the resource Model if there is no attribute for it, so I think this is needed. Comments from Reviewable |
- call context once - add environment_path
…- init updated to handle.
trying to get the attribute error
trying again to print the exception details
move cloudshell required packages to the test_requirements
move the cloudshell packages requirements to test_requirements
removed try/catch to debug exception
This reverts commit 6eabbf1.
Various fixes, runs in 8.0....
This change is